clc,clear
z = readmatrix("C:\Users\Admin\Desktop\小论文\预测结果\3h\3h_result.xlsx");
y = reshape(z,[],1);
ymin=min(y);
ymax=max(y);
x=linspace(-1,1,20);%将最大最小区间分成20个等分点(19等分),然后分别计算各个区间的个数
yy=hist(y,x);%计算各个区间的个数
yy=yy/length(y);%计算各个区间的个数
bar(x,yy);%画出概率密度分布图
hold on;
plot (x,yy,'LineWidth',2);
s=0;
xlabel('x','FontSize',20);
ylabel('PDF','FontSize',20);
set(gca,'linewidth',1,'fontsize',16,'fontname','Times');

% xlswrite('C:\Users\Admin\Desktop\小论文\预测结果\3h\distrbution.xlsx',x','Sheet2')
% xlswrite('C:\Users\Admin\Desktop\小论文\预测结果\3h\distrbution.xlsx',yy','Sheet3')